<?php
	if(!isset($_GET['obj']))
	{
		include '../../View/Admin/view_center_admin.php';
	}
	if(isset($_GET['obj']))
	{
		switch($_GET['obj'])
		{
			case 'sanpham':
				if(isset($_POST['timkiem']))
					{
						if($_POST['key']=='')
							include '../../View/Admin/Search/view_timkiem_sanpham-null.php';
						else
							{
								if(isset($_POST['tuychon_timkiem']))
								{
									switch($_POST['tuychon_timkiem'])
									{
										case 'ten':
											include '../../View/Admin/Search/view_timkiem_sanpham-ten.php';	
										break;
										case 'gia':
											include '../../View/Admin/Search/view_timkiem_sanpham-gia.php';	
										break;
										case 'nhasx':
											include '../../View/Admin/Search/view_timkiem_sanpham-nhasx.php';	
										break;
									}
								}
							}
					}			
					else
					{
					  if(isset($_GET['act']))
					  {
						  switch($_GET['act'])
						  {
							  case 'ad':
								  include "../../View/Admin/view_sanpham_them.php";
								  break;
							  case 'update':
								  include '../../View/Admin/view_sanpham_capnhat.php';
								  break;
							  case 'delete':
								  $id=$_GET['id'];
								  $kq=sanpham::XoaSP($id);
								  if($kq>0)
								  {
									  echo '<script type="text/javascript">alert("Xóa thành công")</script>';
									  include '../../View/Admin/view_sanpham.php';
								  }
								  else
									  echo  '<script type="text/javascript">alert("Xóa thất bại")</script>';
								  break;
							  default:
								  include '../../View/Admin/view_center_admin.php';
								  break;
						  }
					  }
					  else
						  include '../../View/Admin/view_sanpham.php';	
						  }
					break;
			case 'donhang':					
				if(isset($_GET['act']))
				{
					switch($_GET['act'])
					{
						case 'print':
							include "../../View/Admin/view_donhang_in.php";
							break;
						case 'update':
							include '../../View/Admin/view_donhang_capnhat.php';
							break;
						default:
							include '../../View/Admin/view_center_admin.php';
							break;
					}
				}
				else					
					include '../../View/Admin/view_donhang.php';
					break;
			case 'khachhang':
				if(isset($_POST['timkiem']))
				{
					if($_POST['key']=='')
						include '../../View/Admin/Search/view_timkiem_khachhang-null.php';
					else
						{
							if(isset($_POST['timkiem_khachhang']))
							{
								switch($_POST['timkiem_khachhang'])
								{
									case 'hoten':
										include '../../View/Admin/Search/view_timkiem_khachhang-ten.php';	
									break;
									case 'tdn':
										include '../../View/Admin/Search/view_timkiem_khachhang-tendangnhap.php';	
									break;
								}
							}
							
						}
				}
				else
				{	
				  if(isset($_GET['act']))
				  {
					  switch($_GET['act'])
					  {
						  case 'delete':
							  include "ctr_xoakhachhang.php";
							  break;
						  default:
							  include '../../View/Admin/view_center_admin.php';
							  break;
					  }
				  }
				else
					include '../../View/Admin/view_khachhang.php';
				}
				break;
			case 'taikhoan':
				if(isset($_POST['timkiem']))
				{
					if($_POST['key']=='')
						include '../../View/Admin/Search/view_timkiem_taikhoan-null.php';
					else
						{
							if(isset($_POST['timkiem_taikhoan']))
							{
								switch($_POST['timkiem_taikhoan'])
								{
									case 'tendangnhap':
										include '../../View/Admin/Search/view_timkiem_taikhoan-tendangnhap.php';	
									break;
									case 'quyen':
										include '../../View/Admin/Search/view_timkiem_taikhoan-quyen.php';	
									break;
									case 'active':
										include '../../View/Admin/Search/view_timkiem_taikhoan-active.php';	
									break;
								}
							}
						}
				}	
				else
				{			
				if(isset($_GET['act']))
				{
					switch($_GET['act'])
					{
						case 'ad':
							include "../../View/Admin/view_taikhoan_them.php";
							break;
						case 'update':
							include '../../View/Admin/view_taikhoan_capnhat.php';
							break;
						case 'delete':
							include 'ctrl_taikhoan_delete.php';
							break;
						default:
							include '../../View/Admin/view_center_admin.php';
							break;
					}
				}
				else	
						include '../../View/Admin/view_taikhoan.php';
				}
				break;
			case 'gopy':
				if(isset($_POST['timkiem']))
				{
					if($_POST['key']=='')
						include '../../View/Admin/Search/view_timkiem_gopy-null.php';
					else
						{
							if(isset($_POST['timkiem_gopy']))
							{
								switch($_POST['timkiem_gopy'])
								{
									case 'chude':
										include '../../View/Admin/Search/view_timkiem_gopy-chude.php';	
									break;
									case 'ngay':
										//include '../../View/Admin/Search/view_timkiem_gopy-ngay.php';	
									break;
								}
							}
						}
				}	
				else
				{
					if(isset($_GET['act']))
					{
						switch($_GET['act'])
						{
							case 'reply':
								include '../../View/Admin/view_gopy_phanhoi.php';
								break;
							case 'print':
								include '../../View/Admin/view_gopy-in.php';
								break;
							case 'delete':
								include 'ctr_xoagopy.php';
								break;
							default:
								include '../../View/Admin/view_center_admin.php';
								break;
						}
					}
					else	
						include '../../View/Admin/view_gopy.php';	
				}
				break;
			case 'thongke':
				include '../../View/Admin/view_thongke.php';	
				break;
			case 'chiphivanchuyen':
				if(isset($_GET['act']))
				{
					switch($_GET['act'])
					{
						case 'update':
							include '../../View/Admin/view_chiphivanchuyen_capnhat.php';
							break;
						default:
							include '../../View/Admin/view_center_admin.php';
							break;
					}
				}
				else
					include '../../View/Admin/view_chiphivanchuyen.php';
					break;
			case 'lienhe':
				if(isset($_POST['timkiem']))
					{
						if($_POST['key']=='')
							include '../../View/Admin/Search/view_timkiem_lienhe-null.php';
						else
							{
								if(isset($_POST['timkiem_lienhe']))
								{
									switch($_POST['timkiem_lienhe'])
									{
										case 'ten':
											include '../../View/Admin/Search/view_timkiem_lienhe-ten.php';	
										break;
										case 'yahoo':
											include '../../View/Admin/Search/view_timkiem_lienhe-yahoo.php';	
										break;
									}
								}
							}
					}			
					else
					{
					if(isset($_GET['act']))
					{
						switch($_GET['act'])
						{
							case 'ad':
								include "../../View/Admin/view_lienhe_them.php";
								break;
							case 'update':
									include "../../View/Admin/view_lienhe_capnhat.php";
								break;
							case 'delete':
								include 'ctr_xoalienhe.php';
								break;
							default:
								include '../../View/Admin/view_center_admin.php';
								break;
						}
					}
					else	
						include '../../View/Admin/view_lienhe.php';	
					}
					break;
			case 'nhomnguoidung':
				if(isset($_GET['act']))
				{
					switch($_GET['act'])
					{
						case 'ad':
							include "../../View/Admin/view_nhomnguoidung_them.php";
							break;
						case 'update':
							include '../../View/Admin/view_nhomnguoidung_capnhat.php';
							break;
						default:
							include '../../View/Admin/view_center_admin.php';
							break;
					}
				}
				else	
					include '../../View/Admin/view_nhomnguoidung.php';	
					break;
			case 'tintuc':
				if(isset($_POST['timkiem']))
					{
						if($_POST['key']=='')
							include '../../View/Admin/Search/view_timkiem_tintuc-null.php';
						else
							{
								if(isset($_POST['timkiem_tintuc']))
								{
									switch($_POST['timkiem_tintuc'])
									{
										case 'mota':
											include '../../View/Admin/Search/view_timkiem_tintuc-mota.php';	
										break;
										case 'active':
											include '../../View/Admin/Search/view_timkiem_tintuc-active.php';	
										break;
									}
								}
							}
					}			
				else
				{
				if(isset($_GET['act']))
				{
					switch($_GET['act'])
					{
						case 'ad':
							include "../../View/Admin/view_tintuc_them.php";
							break;
						case 'update':
							include '../../View/Admin/view_tintuc_capnhat.php';
							break;
						case 'delete':
							include 'ctr_xoatintuc.php';
							break;
						default:
							include '../../View/Admin/view_center_admin.php';
							break;
					}
				}
				else	
					include '../../View/Admin/view_tintuc.php';
				}
					break;
			default:
				include '../../View/admin/view_center_admin.php';
				break;
			
				
		}	
	}
?>